package controlGraph;

public class LValueInt extends Expression{
	private AbstractInt absInt = null;
	private int IntValue;
	//private AxiomArray axArr = null;
	
	public LValueInt(int num){
		this.IntValue = num;
		this.absInt = new AbstractInt(num);
	//	this.axArr = new AxiomArray();
	}
	
	public LValueInt(Expression passed){
		if(passed instanceof LValueInt){
			this.IntValue = ((LValueInt)passed).getValue();
			this.absInt = new AbstractInt(((LValueInt)passed).getAbsInt());
	//		this.axArr = new AxiomArray();
		}
		else{
			System.out.println("Coding error: Wrong argument passing");
			System.exit(1);
		}
	}
	
	public int getValue(){
		return this.IntValue;
	}
	
	public AbstractInt getAbsInt(){
		return this.absInt;
	}
	
	/*public AxiomArray getAxiomArray(){
		return this.axArr;
	}*/
	
	public void setValue(int num){
		this.IntValue = num;
		this.absInt = new AbstractInt(num);
	}
	
	public boolean isSame(Expression e){
		if(!(e instanceof LValueInt)){
			return false;
		}
		
		if(((LValueInt)e).getValue() == this.IntValue)
			return true;
		
		return false;
	}
	
	public boolean equals(Object e){
		if(!(e instanceof LValueInt)){
			return false;
		}
		
		if(((LValueInt)e).getValue() == this.IntValue)
			return true;
		
		return false;
	}
	
	public int hashCode(){
		return this.IntValue;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return ""+this.IntValue;
	}
}
